# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 10:40
# @Author  : 刘张宇
# @Email   : 2285524065@qq.com
# @File    : .py
# @Software: PyCharm

from appium.webdriver.common.mobileby import MobileBy as By
from pages.base_page import BasePage

class DiscoverFriends(BasePage):
    discover_friends_locaator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/dt_find_friends"]')#点击发现好友定位器
    recommend_locaator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/tab"]/android.widget.LinearLayout[1]/androidx.appcompat.app.ActionBar-Tab[1]')#点击推荐定位器
    title_locator = (By.XPATH, '//*[@text="推荐"]')

    def menu_discover_friends(self):
        self.find_element(self.discover_friends_locaator).click()#点击发现好友

    def menu_recommend(self):
        self.find_element(self.recommend_locaator).click()#点击推荐

    def task_first(self):
        current_task = self.find_element(self.title_locator).text()#推荐
        return current_task